<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>函数</title>

    <script type="text/javascript">
        function fun1() {
            console.log("111");
        }
        fun1();

        var fun2 = function () {
            console.log("222");
        }

        fun2();

        function sayName() {
            console.log(this + "hello");
        }

        var obj = {
            name: "zc",
            sayName: sayName
        }
        sayName()
        obj.sayName()

    </script>

</head>

<body>

</body>

</html>